import 'package:amap_base/amap_base.dart';
import 'package:car_map/mode/navigation_model.dart';
import 'package:car_map/widget/widget_navigation_item.dart';
import 'package:flutter/material.dart';

///加油站
class GasPage extends StatefulWidget{
  @override
  _gasState createState() =>_gasState();

}
class _gasState extends State<GasPage>{

  List<NavigationModel> list;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    navigationList();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('加油站'),
      ),
      body: Container(
        child: ListView.builder(itemBuilder: (context,index){
          return WidgetNavigationItem.widgetNavigationItem(list[index]);
        },itemCount: list.length,),
      ),
    );
  }
  
  //制造假数据
  List<NavigationModel> navigationList(){
    list=new List();
    list.add(new NavigationModel(title: '锦业路加油站',
        address: '陕西省西安市长安区郭杜街道长里村西北方向约1.22公里',
        latitude:34.1820567280,longitude:108.8430976868,
      iconData: Icons.local_gas_station
    ));
    list.add(new NavigationModel(title: '天谷八路加油站',
        address: '陕西省西安市雁塔区漳浒寨街道西南方向',
        latitude:34.2079692069,longitude:108.8370895386,
        iconData: Icons.local_gas_station));
    list.add(new NavigationModel(title: '区经五路',
        address: '陕西省西安市雁塔区丈八沟街道双水磨社区西北方向',
        latitude:34.2179061268,longitude:108.8696193695,
        iconData: Icons.local_gas_station));
  }

}
